﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainFrm.Master" AutoEventWireup="true" CodeBehind="LoadNumByCustomerList.aspx.cs" Inherits="Ewts.Storage.LoadNumByCustomerList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="EwtsConext" runat="server">
<h2>LoadNum列表</h2>
<br />
   处理地：
    <asp:DropDownList ID="dropGraphic" runat="server"   CssClass="dropGraphic"  >
    </asp:DropDownList>
    <input type="hidden" class="hidUname" runat="server" id="hidusrName" />
<div class="shadow2">
<%--    <asp:Repeater ID="reptCustomer" runat="server" 
        onitemcommand="reptCustomer_ItemCommand" 
        onitemdatabound="reptCustomer_ItemDataBound">
      <HeaderTemplate>--%>
 
    <table id="tbCustomer" class="display" cellpadding="0" cellspacing="0" border="0" style="width:100%;">
 
      <thead>
 
        <tr>
 
            <th>序号</th>
            <th>项目编号</th>
            <th>项目名称</th>
            <th>收货日期</th>
            <th>LoadNum单号</th>
            <th>客户</th>
            <th>地址</th>
            <th>业务员</th>
            <th>总重量</th>
             <th>已入库重量</th>
             <th>备注</th>
             <th>状态</th>
            <th>操作</th>
 
        </tr>
 
      </thead>
 
      <tbody>
 
<%--  </HeaderTemplate>
 
  <ItemTemplate>
 
    <tr>
        
      <td><%# Container.ItemIndex + 1%></td>
      <td><%# Eval("pronum")%></td>

      <td><%# Eval("proname")%></td>
 
      <td><%# Eval("cjocolldate")%></td>

      <td><%# Eval("loadnum")%></td>
 
      <td><%# Eval("cumname")%></td>

      <td>
        <%# Eval("addressinfo")%>
      </td>


      <td><%# Eval("cjotruename") %></td>
 
      <td><%# Eval("totalWeight") %></td>
      <td><%# Eval("finishWeight")%></td>
      <td><%# Eval("Memo")%></td>
      <td><%# Eval("cstatus")%></td>
      <td> 
            <a href="/Project/AddressByProjectList.aspx?LoadID=<%# Eval("l_id")%>&cumid=<%# Eval("cumid")%> ">添加CJO</a>   
            
            <a href='CJOByLoadID.aspx?loadid=<%# Eval("l_id") %>'>CJO列表</a>
            
            <asp:LinkButton ID="linkCanel" runat="server" CommandName="作废" Text="作废" ToolTip="作废" Enabled='<%# GetEnable(Eval("c_status").ToString())%>' CommandArgument='<%#Eval("l_id")%>'/>
            
            </td>
            
 
    </tr>
 
  </ItemTemplate>
 
  <FooterTemplate>
 --%>
    </tbody>
 
    </table>
<%-- 
  </FooterTemplate>


    </asp:Repeater>--%>
</div>
    <script type="text/javascript">

        $(document).ready(function () {

             var mtable = $('#tbCustomer').dataTable({ "oLanguage": { "sUrl": "/jquery/jquery.dataTable.cn.txt" },
                "bJQueryUI": true,
                "sPaginationType": "full_numbers",
                'bPaginate': true,
                "bProcessing": true,
                "iDisplayLength": 25,
                "bDestory": true,
                "columns": [
                    { "data": "indexnum" },
                    { "data": "pronum" },
                    { "data": "proname" },
                    { "data": "cjocolldate" },
                    { "data": "loadnum" },
                     { "data": "cumname" },
                     { "data": "addressinfo" },
                    { "data": "cjotruename" },
                    { "data": "totalWeight" },
                    { "data": "finishWeight" },
                    { "data": "Memo" },
                    { "data": "cstatus" },
                     { "data": "operatorurl" }
            ],
                "sAjaxSource": "/ashx/pageJuqery.ashx?pagetype=lnbcl&uname=" + $(".hidUname").val() + "&city=" + encodeURI($(".dropGraphic").val()),
                "bServerSide": true  
            });

            $('.dropGraphic').change(function () {

                mtable.fnReloadAjax("/ashx/pageJuqery.ashx?pagetype=lnbcl&uname=" + $(".hidUname").val() + "&city=" + encodeURI($(".dropGraphic").val()));
            });
        });

        function ZF(obj, cjoid) {
            var s = "";
            var ot = $("#a_" + cjoid).attr("ot");
            var opettype = "";
            if (ot == 1) {
                s = "作废";
                opettype = "cjozfstatus";
            }
            else {
                s = "撤销作废";
                opettype = "cjocxzfstatus";
            }
            if (confirm("确认" + s + "吗？")) {
                $.ajax({
                    type: "post",
                    url: "/ashx/cjoOper.ashx?opettype=" + opettype + "&cjoid=" + cjoid,
                    data: { d: "3" },
                    success: function (msg) {
                        if (msg != 0) {
                            alert('操作成功');
                            var strhtml = "";
                            if (ot == 1) {
                                strhtml = "<a style='color:blue;'>撤销作废</a></span>"
                                $("#a_" + cjoid).attr("ot", "2");
                                $("#a1_" + cjoid).html();
                                // $(obj).attr('onclick', '').click(eval(ZF(obj, cjoid, 2)));
                            }
                            else {
                                strhtml = "<a style='color:blue;'>作废</a>"
                                if (msg == "1") {
                                    $("#a1_" + cjoid).html("待派车");
                                }
                                else {
                                    $("#a1_" + cjoid).html("待收货");
                                }
                                $("#a_" + cjoid).attr("ot", "1");

                                //$(obj).attr('onclick','').click(eval(ZF(obj, cjoid, 1)));
                            }
                            $(obj).html(strhtml);
                        }
                    }
                });
            }

        }


 
</script>

</asp:Content>
